package com.njwb.day15.zqzb.method.proxy;

public class Proxy implements Subject {


    private String name ;


    private Subject realSubject ;
    public Proxy(String name,Subject realSubject) {
        this.name = name;
        this.realSubject = realSubject;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    private void beforeGetMoney(){
        System.out.println("埋个炸弹放在欠债者的老家。");
        System.out.println("在把儿子，女儿全部绑了");
        System.out.println("在多一根手指送到欠债者的面前");
    }

    @Override
    public void getMoney() {
        beforeGetMoney();
        realSubject.getMoney();
        afterGetMoney();
    }


    private  void afterGetMoney(){
        System.out.println("抽30%的成！！！");
    }
}
